//
//  CommonConfig.swift
//  Weibo-YQY-test
//
//  Created by Lang on 10/10/15.
//  Copyright © 2015 Lang. All rights reserved.
//

// 相当于 oc 中的 pch 文件


import Foundation
import UIKit

let SCREENW = UIScreen.mainScreen().bounds.size.width
let SCREENH = UIScreen.mainScreen().bounds.size.height


/// 控制 Log 的打印
///
/// - parameter message:    消息
/// - parameter error:      是否是错误的 log，如果是，一定会打印
/// - parameter fileName:   文件名
/// - parameter line:       行数
/// - parameter methodName: 方法名

func printLog(message: AnyObject, error:Bool = false, fileName: String = __FILE__, line: Int = __LINE__, methodName: String = __FUNCTION__){
    
    if error{
       print("\((fileName as NSString).lastPathComponent)[\(line)], \(methodName):\(message)")
    }else{
        
        #if DEBUG
            print("\((fileName as NSString).lastPathComponent)[\(line)], \(methodName):\(message)")
        #endif
        
    }
}


func RGB(r r:CGFloat, g: CGFloat, b:CGFloat) -> UIColor{
    
    
    return UIColor(red: r/255, green: g/255, blue: b/255, alpha: 1)
}